package james.gan.remoting.netty.server;

import java.net.InetSocketAddress;

import james.gan.container.ServiceContainer;
import james.gan.remoting.api.Server;
import james.gan.remoting.netty.server.NettyServerProxy;
import james.gan.serialization.api.Serialization;

public class NettyServer extends Server {

	NettyServerProxy proxy;
	
	ServiceContainer container;
	
	Serialization serializer;

	@Override
	public void start(int port) throws Exception {
		proxy = new NettyServerProxy(new InetSocketAddress(port), serializer, container);
	}

	@Override
	public void destroy() throws Exception {
		proxy.close();
	}

	public NettyServer(ServiceContainer container, Serialization serializer) {
		super();
		this.container = container;
		this.serializer = serializer;
	}
	
}
